package com.qibo.order;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.hjq.toast.ToastUtils;
import com.qibo.baselib.base.BaseActivity;
import com.qibo.baselib.widget.PayBottomDialog;

/**
 * 订单详情
 */
public class OrderListDetailsActivity extends BaseActivity{
    private ImageButton imageButton;
    private TextView textView_titleBar;
    private PayBottomDialog bottomDialog;
    @Override
    protected int getContentViewId() {
        return R.layout.ordermodule_activity_orderlistdetails;
    }

    @Override
    protected void initView() {
        imageButton = findViewById(R.id.btnBack_pay1);
        textView_titleBar = findViewById(R.id.textView_titleBar);
    }

    @Override
    protected void initAction() {
        imageButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();;
            }
        });
        textView_titleBar.setText("订单详情");
    }

    @Override
    protected void initData() {

    }

    /**
     * 打印小票
     * @param view
     */
    public void orderTvPrintOnClick(View view){
        ToastUtils.show("打印");
    }
    /**
     * 取消
     * @param view
     */
    public void orderTvCancelOnClick(View view){
        AlertDialog dialog = new AlertDialog.Builder(this).setTitle("提示")
                .setNegativeButton("取消", null).setPositiveButton("确定", new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        //处理确认按钮的点击事件
                        finish();
                    }
                }).setMessage("确认取消订单？").create();
        dialog.show();
    }
    /**
     * 收款
     * @param view
     */
    public void orderTvReceiptOnClick(View view){
        bottomDialog = new PayBottomDialog(this,0,bottomDialog);
        bottomDialog.show(getSupportFragmentManager());
    }
}
